.Dd March 15, 2019
.Dt libcpath 3
.Os libcpath
.Sh NAME
.Nm libcpath.h
.Nd Library to support cross-platform C path functions
.Sh SYNOPSIS
.In libcpath.h
.Pp
Support functions
.Ft const char *
.Fn libcpath_get_version "void"
.Ft int
.Fn libcpath_get_codepage "int *codepage" "libcpath_error_t **error"
.Ft int
.Fn libcpath_set_codepage "int codepage" "libcpath_error_t **error"
.Pp
Error functions
.Ft void
.Fn libcpath_error_free "libcpath_error_t **error"
.Ft int
.Fn libcpath_error_fprint "libcpath_error_t *error" "FILE *stream"
.Ft int
.Fn libcpath_error_sprint "libcpath_error_t *error" "char *string" "size_t size"
.Ft int
.Fn libcpath_error_backtrace_fprint "libcpath_error_t *error" "FILE *stream"
.Ft int
.Fn libcpath_error_backtrace_sprint "libcpath_error_t *error" "char *string" "size_t size"
.Pp
Path functions
.Ft int
.Fn libcpath_path_change_directory "const char *directory_name" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_current_working_directory "char **current_working_directory" "size_t *current_working_directory_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_full_path "const char *path" "size_t path_length" "char **full_path" "size_t *full_path_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_sanitized_filename "const char *filename" "size_t filename_length" "char **sanitized_filename" "size_t *sanitized_filename_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_sanitized_path "const char *path" "size_t path_length" "char **sanitized_path" "size_t *sanitized_path_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_join "char **path" "size_t *path_size" "const char *directory_name" "size_t directory_name_length" "const char *filename" "size_t filename_length" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_make_directory "const char *directory_name" "libcpath_error_t **error"
.Pp
Available when compiled with wide character string support:
.Ft int
.Fn libcpath_path_change_directory_wide "const wchar_t *directory_name" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_current_working_directory_wide "wchar_t **current_working_directory" "size_t *current_working_directory_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_full_path_wide "const wchar_t *path" "size_t path_length" "wchar_t **full_path" "size_t *full_path_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_sanitized_filename_wide "const wchar_t *filename" "size_t filename_length" "wchar_t **sanitized_filename" "size_t *sanitized_filename_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_get_sanitized_path_wide "const wchar_t *path" "size_t path_length" "wchar_t **sanitized_path" "size_t *sanitized_path_size" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_join_wide "wchar_t **path" "size_t *path_size" "const wchar_t *directory_name" "size_t directory_name_length" "const wchar_t *filename" "size_t filename_length" "libcpath_error_t **error"
.Ft int
.Fn libcpath_path_make_directory_wide "const wchar_t *directory_name" "libcpath_error_t **error"
.Sh DESCRIPTION
The
.Fn libcpath_get_version
function is used to retrieve the library version.
.Sh RETURN VALUES
Most of the functions return NULL or \-1 on error, dependent on the return type.
For the actual return values see "libcpath.h".
.Sh ENVIRONMENT
None
.Sh FILES
None
.Sh NOTES
libcpath can be compiled with wide character support (wchar_t).
.sp
To compile libcpath with wide character support use:
.Ar ./configure --enable-wide-character-type=yes
 or define:
.Ar _UNICODE
 or
.Ar UNICODE
 during compilation.
.sp
.Ar LIBCPATH_WIDE_CHARACTER_TYPE
 in libcpath/features.h can be used to determine if libcpath was compiled with wide character support.
.Sh BUGS
Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libcpath/issues
.Sh AUTHOR
These man pages are generated from "libcpath.h".
.Sh COPYRIGHT
Copyright (C) 2008-2024, Joachim Metz <joachim.metz@gmail.com>.
.sp
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.Sh SEE ALSO
the libcpath.h include file
